package com.smartcruise.util.network.customerObserver;


import com.smartcruise.util.network.netUtils.Result;

import io.reactivex.functions.Consumer;

/**
 * Created by FengChaoQun
 * on 2018/4/1 0001
 * 自定义的Consumer 添加了runInMainThread字段 标记是否允许在主线程
 */

public abstract class CustomDoOnNext implements Consumer<Result> {

    private boolean runInMainThread;//标记是否允许在主线程

    public CustomDoOnNext(boolean runInMainThread) {
        this.runInMainThread = runInMainThread;
    }

    public CustomDoOnNext() {
        this.runInMainThread = false;
    }

    public boolean isRunInMainThread() {
        return runInMainThread;
    }

    public void setRunInMainThread(boolean runInMainThread) {
        this.runInMainThread = runInMainThread;
    }
}
